var tab = Ext.create('Ext.container.Container', {
  id: "login-tabbar",
  margin : '100 0 100 300',
  anchor : '90%',
  height : 300,
  cls: "loginbox",
    layout: {
      type: "table",
      columns: 2
    },
    tdAttrs: {
      cls: "login-inner"
    },
    items: [ {
      xtype: 'label',
      cls : 'login-inner-label',
      text : 'Username',
      width: 210
    }, {
      xtype: 'textfield',
      border : 0,
      emptyText: 'Username or email',
      id: 'createloginID',
      value: 'admin',
      width: 210,
      fieldCls : 'login-inp'
    }, {
      xtype: 'label',
      cls : 'login-inner-label',
      text : 'Password',
      width: 210
    },{
      xtype: 'textfield',
      emptyText: 'Password',
      id: 'createpassword',
      inputType: 'password',
      value: 'admin',
      width: 210,
     fieldCls : 'login-inp'
    }, {
      xtype: "container",
      colspan: 2,
      layout: {
        type: "hbox",
        align: "right",
        defaultMargins : {top: 10, right: 0, bottom: 0, left: 200}
      },
      items: [ {
        xtype: "button",
        id: "login-signin",
        text: "Sign in",
        cls : 'submit-login',
        handler : function(button) {
            
        	  console.log(loginme.down('#createloginID').value);
              var user = loginme.down('#createloginID').value;
              
          //  Ext.getCmp('login').hide();
            //Ext.getCmp('login').removeAll();
            
        	//EUF.getViewPort().removeAll();
           Ext.getCmp('viewPort1').removeAll();
           var view = Ext.widget('newStudentview');
           Ext.getCmp('viewPort1').add(view);
           Ext.getCmp('welcomeLbl').setText('Welcome '+user);
           
       //     Ext.getCmp('login-tabbar').hide();
         //   Ext.getCmp('login-tabbar').removeAll();
        	console.log(EUF);
        //	this.up('viewPort1').removeAll();

         //      console.log( Ext.getCmp('header'));
           //     var view = Ext.widget('newStudentview',{renderTo:document.body});
                //Ext.create('EUF.view.')
               
            
              //  this.up('viewPort1')..add(view);
               // Ext.getCmp('login').add(view);
                
                     
        }
      } ]
    } ]
  
});
Ext.define("EUF.view.login", {
  extend: "Ext.container.Container",
  
  alias :'widget.login',
  id : 'login',
      height : '100%',
    width : '100%',
   loginme : null,
  initComponent: function() {
	  loginme = this;
    this.layout = {
      type: "anchor",
      align: "stretch"
    }
    this.items = [ 
       tab
    ];
    this.callParent(arguments);
  }
});
